package com.situ.mall.web.service;

import com.mall.common.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 通知服务 Feign 客户端
 */
@FeignClient(name = "notification-api", path = "/api/notifications", contextId = "notification-api")
public interface NotificationFeignService {

    /**
     * 获取通知列表（分页）
     */
    @GetMapping("/findAll")
    ResponseEntity<JsonResult<?>> getUserNotifications(@RequestParam("pageNo") Integer pageNo,
                                                       @RequestParam("pageSize") Integer pageSize,
                                                       @RequestParam(value = "userId", required = false) Integer userId);

    /**
     * 根据ID获取通知详情
     */
    @GetMapping("/findById")
    ResponseEntity<JsonResult<?>> getNotificationById(@RequestParam("id") Integer id);

    /**
     * 更新通知
     */
    @PutMapping("/update")
    ResponseEntity<JsonResult<?>> updateNotification(@RequestBody Map<String, Object> notification);

    /**
     * 批量删除通知
     */
    @DeleteMapping("/deleteByIds")
    ResponseEntity<JsonResult<?>> deleteNotifications(@RequestBody java.util.List<Integer> ids);

    /**
     * 保存通知
     */
    @PostMapping("/save")
    ResponseEntity<JsonResult<?>> saveNotification(@RequestBody Map<String, Object> notification);

    /**
     * 订单状态变更通知
     */
    @PostMapping("/orderStatusChange")
    ResponseEntity<JsonResult<?>> orderStatusChange(@RequestBody Map<String, Object> dto);

    /**
     * 商品价格变动通知
     */
    @PostMapping("/priceChange")
    ResponseEntity<JsonResult<?>> priceChange(@RequestBody Map<String, Object> dto);

    /**
     * 安全警报通知
     */
    @PostMapping("/securityAlert")
    ResponseEntity<JsonResult<?>> securityAlert(@RequestBody Map<String, Object> dto);

    /**
     * 系统通知
     */
    @PostMapping("/systemAlert")
    ResponseEntity<JsonResult<?>> systemAlert(@RequestBody Map<String, Object> dto);
} 